@tool
class_name WanderContextBehavior
extends BaseContextBehavior

#region 属性
@export var offest:float
@export var radius:float
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func init_context(steering_component:SteeringComponent,resolution_radio:int):
	super.init_context(steering_component,resolution_radio)
func get_interest(entity:CharacterEntity,directions:Array[Vector2]) -> Array[float]:
	var interest:Array[float] = []
	interest.resize(directions.size())
	var dir = entity.get_vel() + entity.get_vel().normalized() * offest + Util.get_random_point_on_circle(Vector2.ZERO,radius)
	dir = dir.normalized()
	for i in range(directions.size()):
		interest[i] = directions[i].dot(dir) * sensitive
	return interest
func get_danger(entity:CharacterEntity,directions:Array[Vector2]) -> Array[float]:
	var danger:Array[float] = []
	danger.resize(directions.size())
	return danger
#endregion
#region 公共方法
#endregion
#region 私有方法
#endregion
#region 生命周期函数
func _draw() -> void:
	super._draw()
#endregion

